/**
 * 
 */
package com.orange.modules.dao.manage;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.orange.dbhelp.DbHelper;
import com.orange.modules.entity.manage.AuthCity;

/**
 * @author gaogs
 *
 * 2016-12-5
 */
@Repository
public class AuthCityRepository {
	
	@Resource(name = "dbHelper")
	private DbHelper dbHelper;
	
	@Autowired
	private AuthCityDao authCityDao;
	
	/**
	 * 查询所有的城市
	 * @return
	 * @throws SQLException
	 */
	public List<AuthCity> queryAuthCityAll() throws SQLException{
		String sql="SELECT a.p_id as pid ,a.s_type as type ,a.s_name as name ,a.f_parent_id as parentId " +
				" FROM t_auth_city as a WHERE a.s_type='2' AND a.f_parent_id='11'";
		List<AuthCity> list=dbHelper.getBeanList(sql, AuthCity.class);
		return list;
	}

}
